import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { RequestParams, LibraryPageVo, ResponseData } from "./types";

/**
 * 列表数据
 * @param data {LoginData}
 * @returns
 */
export function getLibraryList(
  data: RequestParams
): AxiosPromise<ResponseData<LibraryPageVo>> {
  return request({
    url: "/api/v1/operationLog/page",
    method: "post",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
}
/**
 * 删除图书馆
 */
export const dellibrary = (ids: string) => {
  return request.delete(`/api/v1/operLog/${ids}`);
};
/**
 * 导出
 *
 * @param queryParams
 * @returns
 */
export function exportLog(data: any) {
  return request({
    url: `/api/v1/operationLog/export`,
    method: "post",
    responseType: "arraybuffer",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
}
